package runableEx;

import java.util.Collection;
import java.util.function.Consumer;
import java.util.function.Predicate;

/**
 * @author ZhuQi
 * @ClassName CollectionUtil
 * @Date 2022/10/18 14:01
 * @Version 1.0
 * @Description TODO
 */
public interface CollectionUtil<T> extends Collection<T> {

    default void forEachIf(Consumer<T> consumer, Predicate<T> predicate) {
        forEach(item -> {
            if (predicate.test(item))
                consumer.accept(item);
        });
    }
}
